//
//  SEGOpenDoorProblemViewController.m
//  SEGUhomeIntelligentHardware
//
//  Created by Clavis on 2018/8/20.
//  Copyright © 2018 刘山. All rights reserved.
//

#import "SEGOpenDoorProblemViewController.h"
#import "SEGOpenDoorNoticeChooseViewController.h"

@interface SEGOpenDoorProblemViewController ()

@end

@implementation SEGOpenDoorProblemViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    [self setupUI];
}

- (void)viewWillAppear:(BOOL)animated{
    [super viewWillAppear:animated];
    if (self.isHideBar) {
        self.navigationController.navigationBarHidden = NO;
    }
}
- (void)viewWillDisappear:(BOOL)animated {
    [super viewWillDisappear:animated];
    if (self.isHideBar) {
        self.navigationController.navigationBarHidden = YES;
    }
}

- (void)setupUI {
    self.title = @"门禁答疑";
    self.view.backgroundColor = kColor_bg;
    
    UIButton *settingNoticeSoundsBtn = [UIButton buttonWithType:UIButtonTypeCustom];
    settingNoticeSoundsBtn.contentHorizontalAlignment = UIControlContentHorizontalAlignmentLeft;
    settingNoticeSoundsBtn.contentEdgeInsets = UIEdgeInsetsMake(0, 20, 0, 0);
    [settingNoticeSoundsBtn setTitle:@"设置提示音" forState:UIControlStateNormal];
    [settingNoticeSoundsBtn setTitleColor:kColor_2 forState:UIControlStateNormal];
    settingNoticeSoundsBtn.titleLabel.font = kFont_14;
    settingNoticeSoundsBtn.frame = CGRectMake(0, 0, LYScreenWidth(), 44);
    settingNoticeSoundsBtn.backgroundColor = kColor_W;
    [settingNoticeSoundsBtn addTarget:self action:@selector(settingNoticeSoundBtnTap:) forControlEvents:UIControlEventTouchUpInside];
    [self.view addSubview:settingNoticeSoundsBtn];
    
    UIButton *opendoorUseGuideBtn = [UIButton buttonWithType:UIButtonTypeCustom];
    opendoorUseGuideBtn.contentHorizontalAlignment = UIControlContentHorizontalAlignmentLeft;
    opendoorUseGuideBtn.contentEdgeInsets = UIEdgeInsetsMake(0, 20, 0, 0);
    [opendoorUseGuideBtn setTitleColor:kColor_2 forState:UIControlStateNormal];
    opendoorUseGuideBtn.titleLabel.font = kFont_14;
    [opendoorUseGuideBtn setTitle:@"手机开门使用攻略" forState:UIControlStateNormal];
    opendoorUseGuideBtn.frame = CGRectMake(0, 45, LYScreenWidth(), 44);
    opendoorUseGuideBtn.backgroundColor = kColor_W;
    [opendoorUseGuideBtn addTarget:self action:@selector(opendoorUseGuideBtnTap:) forControlEvents:UIControlEventTouchUpInside];
    [self.view addSubview:opendoorUseGuideBtn];
    
    UIImageView *arrow = [[UIImageView alloc] initWithImage:[UIImage imageNamed:SEGPicName(@"btn_more_gray")]];
    arrow.contentMode = UIViewContentModeCenter;
    arrow.frame = CGRectMake(LYScreenWidth() - 44, 0, 44, 44);
    [settingNoticeSoundsBtn addSubview:arrow];
    
    UIImageView *arrow2 = [[UIImageView alloc] initWithImage:[UIImage imageNamed:SEGPicName(@"btn_more_gray")]];
    arrow2.contentMode = UIViewContentModeCenter;
    arrow2.frame = CGRectMake(LYScreenWidth()- 44, 0, 44, 44);
    [opendoorUseGuideBtn addSubview:arrow2];
}

- (void)settingNoticeSoundBtnTap:(UIButton *)sender {
    SEGOpenDoorNoticeChooseViewController *settingVC = [SEGOpenDoorNoticeChooseViewController new];
    settingVC.isHideBar=YES;
    [self.navigationController pushViewController:settingVC animated:YES];
}

- (void)opendoorUseGuideBtnTap:(UIButton *)sender {
    
}

@end
